package com.dios.mirage.component;

import net.rim.device.api.system.Bitmap;
import net.rim.device.api.system.Display;
import net.rim.device.api.ui.Color;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.component.BitmapField;
import net.rim.device.api.ui.container.HorizontalFieldManager;
import net.rim.device.api.ui.decor.BackgroundFactory;

public class BannerFieldManager extends HorizontalFieldManager {
	
	BitmapField logoLeftField;
	BitmapField logoRightField;

	public BannerFieldManager() {
		createGUI();
		setBackground(BackgroundFactory.createSolidBackground(Color.RED));
	}

	protected void sublayout(int maxWidth, int maxHeight) {
		super.sublayout(Display.getWidth(), 78);
		setExtent(Display.getWidth(), 78);
	}

	public void createGUI() {
		logoLeftField = new BitmapField(Bitmap.getBitmapResource("img/leftlogo.gif"),Field.FIELD_RIGHT);
		logoRightField = new BitmapField(Bitmap.getBitmapResource("img/rightlogo.gif"),Field.FIELD_RIGHT);
		logoLeftField.setMargin(0, 0, 0, 30);
		add(logoRightField);
		add(logoLeftField);
	}

}
